import config from './config.js'
import request from './request.js'

let url = config.baseURL
const todourl=config.todoURL

//地址验证接口
export const apiAddressCheck = data => {
	return request.send({
		url:url + 'verifyPunchAddress',
		data:data,
		type:'POST'
	})
}

//获取用户当天打卡信息
export const apiCardInfo = () => {
	return request.send({
		url:url + 'getCurDayPunchInfo'
	})
}

//上班打卡接口
export const apiGetClock = data => {
	return request.send({
		url:url + 'goWorkPuch',
		data:data,
		type:'POST'
	})
}

//下班打卡接口
export const apiGetOffWork = data => {
	return request.send({
		url:url + 'goAfterWorkPuch',
		data:data,
		type:'POST'
	})
}

//获取公司列表
export const apiCompanyList = (data) => {
	return request.send({
		url:url + 'companyList',
		data:data
	})
}


//补卡申请
export const apiSupplement = (data) => {
	return request.send({
		url:url + 'applyFillCard',
		data:data,
		type:'POST'
	})
}

//获取用户信息

export const apiUserInfo = () => {
	return request.send({
		url:url + 'getUser'
	})
}

//获取当前月份打卡信息

export const apiGetCardDays = (year,month) => {
	return request.send({
		url:url + 'getUserPunchDayInfo?hr_attend_startWork='+year+'&hr_attend_knockOff='+month
	})
}

//获取指定天数打卡信息

export const apiGetAppointTimeData = (date) => {
	return request.send({
		url:url + 'getUserDatePunchInfo?hr_attend_date='+date
	})
}

//发起个推id存储请求

export const apiPushUser = (data) => {
	return request.send({
		url:url + 'push/pushUser',
		data:data,
		type:'POST'
	})
}

//向指定用户推送消息
export const apiAppointPush = (data) => {
	return request.send({
		url:url + 'push/AppointPush',
		data:data,
		type:'POST'
	})
}

//获取通知消息接口

export const apiGetNotice = () => {
	return request.send({
		url:url + 'card/getNotice'
	})
}

//获取补卡审批消息接口

export const apiGetNews = () => {
	return request.send({
		url:url + 'getUnreviewedAttendApply'
	})
}

//获取补卡审批信息接口

export const apiGetApplyData = (apply_id) => {
	return request.send({
		url:url + 'getAssingnationAttendApply?hr_attend_apply_id='+apply_id
	})
}

//同意审批接口

export const apiExaminationAndApproval = (data) => {
	return request.send({
		url:url + 'agreeAttendApply',
		data:data,
		type:'POST'
	})
}


//拒绝审批接口

export const apiRejectAttendApply = (data) => {
	return request.send({
		url:url + 'rejectAttendApply',
		data:data,
		type:'POST'
	})
}

//获取版本信息接口

export const apiCheckVersion = () => {
	return request.send({
		url:url + 'appVersion'
	})
}


export const apiTypeInfo = (data) => {
	return request.send({
		url:url + 'GetUi/typeInfo',
		data:data,
		type:'POST'
	})
}


//获取审批人信息接口
export const apiApproverInfo = (data) => {
	return request.send({
		url:url + 'getLeaveData'
	})
}

//发起请假流程接口

export const apiLeave = (data)=>{
	return request.send({
		url:url + 'saveLeave',
		data:data,
		type:'POST'
	})
}


//发起外勤接口

export const apiGoOut = (data)=>{
	return request.send({
		url:url + 'saveFieldPersonnel',
		data:data,
		type:'POST'
	})
}

//代办事项获取接口

export const apitodo = (data)=>{
	return request.send({
		url:url + 'findTaskList',
		data:data
	})
}

//根据外勤id获取外勤单接口
export const apigetFielddata = (getId)=>{
	return request.send({
		url:url + 'getFieldPersonnelById',
		data:getId
	})
}

//办理外勤单流程接口
export const apipassField=(data)=>{
	return request.send({
		url:url+'passFieldPersonnel',
		data:data,
		type:'POST'
	})
}


//获取所有用户信息
export const apiAllUser=(data)=>{
	return request.send({
		url:url+'userLists',
		data:data
	})
}


//个人当月考勤
export const apigetAttendance=(data)=>{
	return request.send({
		url:url+'getAttendanceStatistics',
		data:data
	})
}

//获取当前用户的补卡申请信息
export const apigetcardInfo=()=>{
	return request.send({
		url:url+'getCurAttendApplyInfo'
	})
}

//查询所有请假记录
export const apigetAllLeaveList=(data)=>{
	return request.send({
		url:url+'leaveList',
		data:data,
		type:'POST'
	})
}

//查询当前用户所有请假单
export const apigetLeaveList=(data)=>{
	return request.send({
		url:url+'getLeaveList',
		data:data
	})
}

//删除指定请假记录
export const apideleLeave=(leaveId)=>{
	return request.send({
		url:url+'deleLeave',
		data:leaveId,
		type:'DELETE'
	})
}

//结束外勤接口
export const apiendOutWork=(filedid)=>{
	return request.send({
		url:url+"endOutWorkActive",
		type:"POST",
		data:filedid
	})
}

//获取公司所有人的通讯录
export const apicompanyContact=()=>{
	return request.send({
		url:url+'companyUserContact'
	})
}

//获取流程线
export const apigetProcessList=(data)=>{
	return request.send({
		url:url+'getProcessList',
		data:data
	})
}

//
export const apigetCostappById=(data)=>{
	return request.send({
		url:url+'getCostappById',
		data:data
	})
}